{{#extends @html/layouts/layout-rss.html}}

{{:init}}
	{{!connect "screen/widgets-default.css" media="screen" charset="utf-8"}}
	{{!connect "cpaint2.inc.js"}}
	{{!connect "misc.js"}}
{{/:init}}

{{:content_class}}rss-aggregator rss-aggregator-addtheme rss-aggregator-rss{{/:content_class}}

{{:layout_right}}{{/:layout_right}}

{{:layout_left}}
	{{@html/widgets/preferences_navigation.html}}
{{/:layout_left}}

{{:layout_main}}
	{{!connect "screen/content-preferences.css" media="screen"}}
	<script>
	var cp = new cpaint();
	
	jQuery().ready( function() {
		getFilterForm();
	});
	
	function getFilterForm() {
		cp.call( get__Url('/ajax'), 'ajax_getFilterForm', function(result) {
      jQuery("#filter_form").html( result.ajaxResponse[0].data );
		}, jQuery("#current_filter").val() );
	}
	</script>
	<h1 class="title-">Создание фильтра для темы &laquo;{{theme.title}}&raquo;</h1>
  <div id="rh_alert" style="margin: 0px;" class="html-alert html-alert-main dn"><div class="bg1-"><div class="bg2-"><div class="bg3-">
		<a href="#"><img src="{{!static type="images" "alert-close.gif"}}" alt="[×]" title="Закрыть сообщение" class="close-" /></a>
		<span id="rh_message" class="message-">{{rh.ui_message_cookie}}</span>
	</div></div></div></div>
	<form action="{{/}}{{community.url}}/filter" method="POST">
  <input type="hidden" name="oid" value="{{item.oid}}">
	<input type="hidden" name="theme_oid" value="{{theme.oid}}">
	<input type="hidden" name="lpage" value="{{lpage}}">
	<input type="hidden" name="show_all" value="{{?show_all}}yes{{/?}}">
	<!-- fieldset class="fieldset- text-">
		<h2 class="subhead-">Название темы</h2>
		<input type="text" value="{{?item}}{{item.title}}{{/?}}" name="title" id="theme_title" class="field-" />
	</fieldset -->
	<fieldset class="fieldset- select-">
		<h2 class="subhead-">Фильтр</h2>
		<select name="filter" class="field-" id="current_filter" onchange="getFilterForm();">
			{{!for filters_list do=@:filters_list}}
			{{:filters_list}}
			<option value="{{*oid}}"{{?*current}} selected{{/?}}>{{*title}}</option>
			{{/:filters_list}}
		</select>
	</fieldset>
  <div id="filter_form"></div>
	<fieldset class="fieldset- text-">
		<h2 class="subhead-">Действие с найденными</h2>
		<input type="radio" value="kill" {{?item.action=='kill' || !action}}checked="checked" {{/?}}name="action" class="field-" />&nbsp;Удалить<br />
    <input type="radio" value="publish" {{?item.action=='publish'}}checked="checked" {{/?}}name="action" class="field-" />&nbsp;Опубликовать<br />
    <input type="radio" value="moderated" {{?item.action=='moderated'}}checked="checked" {{/?}}name="action" class="field-" />&nbsp;Отправить на модерацию<br />
	</fieldset>
	<div class="buttons-">
		<input type="image" src="{{!static type="images" "rss/save.gif"}}" alt="Сохранить" class="button-" />
		<a href="{{/}}{{community.url}}/theme/{{theme.oid}}{{?lpage}}?lpage={{lpage}}{{?:}}{{?show_all}}?show_all=1{{/?}}{{/?}}"><img src="{{!static type="images" "rss/cancel.gif"}}" alt="Отмента" class="button-" /></a>
	</div>
	</form>

{{/:layout_main}}